import os

def get_hiddenimports(folder_path):
    # 文件夹路径
    folder_path = folder_path
    
    # 获取文件夹下所有的.py文件
    files = [f for f in os.listdir(folder_path) if f.endswith('.py')]
    
    # 生成hiddenimports参数
    hiddenimports = ["'{}.{}'".format(folder_path.replace('/', '.').lstrip('.'), os.path.splitext(f)[0]) for f in files]
    
    # 打印出来供PyInstaller使用
    print(','.join(hiddenimports))

if __name__ == '__main__':
    get_hiddenimports('webapiback/shares')